from flask_restful import Api
from comment.utils.output import output_json
from flask import Blueprint
# 交易模块下的蓝图，包括交易模块的所有资源
from financial.resource.transaction import invest_resource

transaction_bp = Blueprint('transaction',__name__ ,url_prefix='/transaction') #创建蓝图

transaction_api = Api(transaction_bp)


transaction_api.representation('application/json')(output_json)

# 加载当前模块的资源
from financial.resource.transaction.loan_resource import LoanApply
from financial.resource.transaction.loan_resource import MyLoanApply
from financial.resource.transaction.debt_resource import Debt
from financial.resource.transaction.invest_resource import Invest_Resource
from financial.resource.transaction.debt_repay_resource import RepayPlan
from financial.resource.transaction.matched_resource import MatchUp
from financial.resource.transaction.allMatched_resource import AllMatchedResource
from financial.resource.transaction.expectedReturn_resource import ExpectedReturnResource
from financial.resource.transaction.investIncome_resource import InvestIncomeResource
from financial.resource.transaction.matched_result_resource import MatchedResultResource
from financial.resource.transaction.deal_record_resource import Deal_Reource




transaction_api.add_resource(Invest_Resource,'/invest_record',endpoint='invest_record') # # 查询投资记录
transaction_api.add_resource(Deal_Reource,'/deal_record', endpoint='deal_record')  # 交易记录
transaction_api.add_resource(LoanApply,'/loanApply',endpoint='loanApply') # 借款申请
transaction_api.add_resource(MyLoanApply,'/myLoan',endpoint='myLoan') # 我的借款
transaction_api.add_resource(Debt,'/debt',endpoint='debt') #债券
transaction_api.add_resource(RepayPlan,'/RepayPlane',endpoint='RepayPlane') #还款计划
transaction_api.add_resource(Invest_Resource,'/invest',endpoint='invest') #投资购买理财产品
transaction_api.add_resource(MatchUp,'/mathcUp',endpoint='mathcUp' )  # 撮合匹配
transaction_api.add_resource(AllMatchedResource,'/fundsNotMatched',endpoint='AllMatchedResource' )  # 未匹配资金
transaction_api.add_resource(ExpectedReturnResource,'/exceptedReturn',endpoint='ExpectedReturnResource')  # 预期收益
transaction_api.add_resource(InvestIncomeResource,'/getIncome',endpoint='InvestIncomeResource')   # 获取收益
transaction_api.add_resource(MatchedResultResource,'/matchedResult',endpoint='MatchedResultResource')  # 匹配结果